package guicommon.controls;

import guicommon.gui.ControlMessage;
import guicommon.gui.LabelMessage;
import java.awt.Component;
import javax.swing.JLabel;

public class Label extends Control {

    private JLabel label;

    public void SetText(String text) {
        Update("SetText", text);
        label.setText(text);
    }

    public Label() {
        label = new JLabel();
    }

    public String GetText() {
        return label.getText();
    }

    @Override
    public ControlMessage ToMessage() {
        LabelMessage result = new LabelMessage();
        SetCommonFields(result);
        result.SetText(GetText());
        return result;
    }

    protected Component GetComponent() {
        return label;
    }
}
